/**
 * Created with IntelliJ IDEA.
 * User: liulinhui
 * Date: 2020/5/24
 * Time: 9:59 PM
 * Description: login
 */
const {GET, POST, CALLBACK} = require('../index');

describe('#登录接口测试', () => {

        it('获取手机验证码', (done) => {
            GET({
                login: false,
                url: '/common/smsCode',
                data: {
                    phone: '15189707661'  //手机号码
                },
                doneCall: done
            })
        });

        it('注册接口', (done) => {
            POST({
                login: false,
                url: '/register',
                data: {
                    phone: '15189707661',  //手机号码
                    password: '123',  //密码
                    code: '666666', //验证码
                    uuid: '1267459806462615553', //验证码对应的UUID
                    inviteMember: '', //邀请人
                    email: '', //可选
                    openid: '', //前端微信登陆对接可拿到（微信内需传）
                    avatar: '', //同上
                    userName: '',//同上

                },
                doneCall: done
            })
        });

        it('登录接口', (done) => {
            POST({
                login: false,
                url: '/login',
                data: {
                    phone: '15189707660',  //手机号码
                    password: '123',  //密码
                    code: '666666', //验证码
                    uuid: '1267455615019524097', //验证码对应的UUID
                    openid: '', //前端微信登陆对接可拿到（微信内需传）
                    avatar: '', //同上
                    userName: '',//同上

                },
                doneCall: done
            })
        });

        //如果用用户的openid已经注册了返回token,否则返回用户微信信息
        it('根据code获取用户基本信息', (done) => {
            GET({
                login: false,
                url: '/loginByCode',
                data: {
                    code: '' //前端微信登录对接获取的code
                },
                doneCall: done
            })
        });

    }
)